package com.book.service.impl;

import com.book.model.TReaders;
import com.book.mapper.TReadersDao;
import com.book.service.TReadersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wx
 * @since 2023-10-13 10:37:37
 */
@Service
public class TReadersServiceImpl extends ServiceImpl<TReadersDao, TReaders> implements TReadersService {
    @Autowired
    private TReadersDao tReadersDao;

    @Override
    public List<TReaders> getAllReader() {

        List<TReaders> tReaders = tReadersDao.selectList(null);
        return tReaders;
    }

    @Override
    public void deleteReader(Long id) {
        tReadersDao.deleteById(id);
    }

    @Override
    public void addReader(TReaders tReaders) {
        tReadersDao.insert(tReaders);
    }

    @Override
    public void updateReader(TReaders tReaders) {
        tReadersDao.updateById(tReaders);
    }

}
